<template>
  <div class="initiateProcess">
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="menuName" label="菜单名称"> </el-table-column>
      <el-table-column prop="menuId" label="菜单id"> </el-table-column>
      <el-table-column fixed="right" label="操作" width="100">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small"
            >发起</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { listModelMenu } from "@/api/model";
export default {
  data() {
    return {
      tableData: [],
    };
  },
  created() {
    listModelMenu().then((res) => {
      if (res.code === 200) {
        this.tableData = res.data;
      }
    });
  },
  methods: {
    handleClick(row) {
      this.$store.dispatch("workflow/getModel", {
            menuId:row.menuId,
            type: "launch",
          });
    },
  },
};
</script>

<style lang="scss" scoped></style>
